From: Kevin Israel Date: Fri, 5 Jul 2013 21:28:37 +0000 (-0400) Subject: Unbreak cascading protection X-Git-Tag: 1.31.0-rc.0~19230^2 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=80823c253992da9bd802265ad51d559b7000de80;p=lhc%2Fweb%2Fwiklou.git Unbreak cascading protection Title::getRestrictions can return "sysop", which will not match if replaced out of $cascadingRestrictionLevels but not $editrestriction, making it impossible to cascade protect a page with the default value of $wgCascadingRestrictionLevels. Follows-up I6bf650a3fbdab8589ae6945c8c916eafd949e41c. Change-Id: Ie7183ed9509ea9c65a7197fc9cead6c8423b852e --- diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 4aab67474c..910aeaef61 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -2346,6 +2346,12 @@ class WikiPage implements Page, IDBAccessObject { // Only certain restrictions can cascade... Otherwise, users who cannot normally protect pages // could "protect" them by transcluding them on protected pages they are allowed to edit. $editrestriction = isset( $limit['edit'] ) ? array( $limit['edit'] ) : $this->mTitle->getRestrictions( 'edit' ); + foreach ( array_keys( $editrestriction, 'sysop' ) as $key ) { + $editrestriction[$key] = 'editprotected'; // backwards compatibility + } + foreach ( array_keys( $editrestriction, 'autoconfirmed' ) as $key ) { + $editrestriction[$key] = 'editsemiprotected'; // backwards compatibility + } $cascadingRestrictionLevels = $wgCascadingRestrictionLevels; foreach ( array_keys( $cascadingRestrictionLevels, 'sysop' ) as $key ) {